package dao;

import Utils.DataSourceUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import pojo.Project;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public class ProjectDao {
    public List<Project> getAllProject()  {
        List<Project> projectList=null;
        QueryRunner queryRunner=new QueryRunner(DataSourceUtils.getDataSource());
        String sql="select * from t_project";
        try {
            projectList= queryRunner.query(sql,new BeanListHandler<>(Project.class));
        }catch (SQLException e){
            e.printStackTrace();

        }finally {
            DataSourceUtils.releaseAndCloseConnection();
        }
       return  projectList;
    }
    public  void  setProject(List<Project> projectList){
        QueryRunner queryRunner=new QueryRunner(DataSourceUtils.getDataSource());
        String sql="inset into t_project "
    }
}
